﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Permission.aspx.cs" Inherits="InventoryProject.Setting.Permission" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type='text/javascript'>

    function popupForm(Code, ctlID, ctlName) {
        var newwindow = window.open("/Setting/dlgPopup.aspx?Code=" + Code + "&ctlID=" + ctlID + "&ctlName=" + ctlName, "List", "scrollbars=no,resizable=no,width=400,height=280");
        if (window.focus) { newwindow.focus() }
        return false;
    }
    function PopupReturn(popupValues, ctlID, ctlName) {
        alert(ctlID);
        document.getElementById(ctlID).value = popupValues[1];
        document.getElementById(ctlName).value = popupValues[0];
        // alert(popupValues[0]); // ItemCd
        // alert(popupValues[1]); // ItemNm
    }
</script>
<div class="editform">    
        <ul>
            <li>
                <div class="divColumn">
                    <label class="label">Mã hệ thống</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtID" class="textbox" Enabled="false"></asp:TextBox>
                </div>
                <div class="clear"></div>
            </li>
            <li>
                <div class="divColumn">
                    <label class="label">Mã người dùng</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtUserID" ClientIDMode="Static" Width="120px" class="textbox popuptext" Ondblclick="popupForm('USR','txtUserNm','txtUserID')"></asp:TextBox>
                </div>
                <div class="divColumn">
                    <label class="label">Tên người dùng</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtUserNm" ClientIDMode="Static" Width="140px" class="textbox" Enabled="false"></asp:TextBox>
                </div>
                             
                <div class="clear"></div>
            </li>
            <li>
                <div class="divColumn">
                    <label class="label">FormID</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtFormID" class="textbox popuptext" ClientIDMode="Static" Ondblclick="popupForm('FRM','txtFormNm','txtFormID')"></asp:TextBox>                    
                </div>
                <div class="divColumn">
                    <label class="label">Tên form</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtFormNm" ClientIDMode="Static" Width="200px" class="textbox"></asp:TextBox>
                </div>
                             
                <div class="clear"></div>
            </li>
            <li>
                 <div class="divColumn">
                    <label class="label">Module</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtModuleID" class="textbox"></asp:TextBox>
                </div>
                <div class="divColumn">
                    <label class="label">Đường dẫn</label>
                    <br/>
                    <asp:TextBox runat="server" ID="txtFilePath" Width="200px" class="textbox"></asp:TextBox>
                </div>   
               
                <div class="clear"></div>
            </li>
            <br />
            <div class="editbutton">
                <asp:Button runat="server" class="button" ID="btnSave" Text="Lưu" 
                    onclick="btnSave_Click" />
                <asp:Button runat="server" class="button" ID="btnClear" Text="Clear" 
                    onclick="btnClear_Click" />
            </div>
            <br />
            <asp:GridView ID="grdData" runat="server" AutoGenerateColumns="false" DataKeyNames="ID"
                    AllowSorting="true" AllowPaging="true" PageSize="5" 
                    PagerSettings-Mode="NextPreviousFirstLast" 
                    onrowcommand="grdData_RowCommand" onrowdeleting="grdData_RowDeleting"                      
                     onrowdatabound="grdData_RowDataBound">
            <HeaderStyle BackColor="AliceBlue" />
            <Columns>                
                <asp:BoundField HeaderText="Mã hệ thống" DataField="ID" Visible="false"/>
                <asp:BoundField HeaderText="Mã người dùng" DataField="UserID" HeaderStyle-Width="100px" />                
                <asp:BoundField HeaderText="FormID" DataField="FormID" HeaderStyle-Width="140px" />
                <asp:BoundField HeaderText="IsView" DataField="IsView" HeaderStyle-Width="100px" />
                <asp:BoundField HeaderText="IsAdd" DataField="IsAdd" HeaderStyle-Width="100px" />
                <asp:BoundField HeaderText="IsUpdate" DataField="IsUpdate" HeaderStyle-Width="100px" />
                <asp:BoundField HeaderText="IsDelete" DataField="IsDelete" HeaderStyle-Width="100px" />
                <asp:BoundField HeaderText="IsPrint" DataField="IsPrint" HeaderStyle-Width="100px" />
                <asp:BoundField HeaderText="IsExport" DataField="IsExport" HeaderStyle-Width="100px" />                
                
                <asp:CommandField ButtonType="Image" ShowDeleteButton="true" DeleteText="Xóa" HeaderStyle-Width="50px" ItemStyle-HorizontalAlign="Center" />
            </Columns>
        </asp:GridView>
        </ul>
    </div>
</asp:Content>
